<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'checkExit.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script src="js/jquery-1.9.1.js" type="text/javascript"></script>
	<script src="js/jquery.json-2.4.js" type="text/javascript"></script>
	<script type="text/javascript">
	/* 用户名验证 */
	$(function(){
		var inputName = $("#userName");
		inputName.bind({
			blur: function(){
			var userName = $("#userName").val();
				$.ajax({
					type:"post",
					url:"admin/userIsExit",
					data:"userName="+userName,
					success:function(text){
						$("#isExit").html(text);
					}
				});  
			}
		});
	});
	</script>
	
	
	<!-- 邮箱验证 -->
	<script type="text/javascript">
	$(function(){
		var inputEmail = $("#email");
		inputEmail.bind({
			blur: function(){
			var emailStr = $("#email").val();
				$.ajax({
					type:"post",
					url:"admin/emailIsExit",
					data:"emailStr="+emailStr,
					success:function(text){
						$("#isExitEmail").html(text);
					}
				});  
			}
		});
	});
	</script>
  </head>
  
  <body>
  	用户名：
  	<input type="text" id="userName" ><span style="font-size:12px;color:red;" id="isExit"></span><br/>
  	<br/>
  	<br/><br/>
  	<br/><br/>
  	输入邮箱：
  	<input type="text" id="email" ><span style="font-size:12px;color:red;" id="isExitEmail"></span>
  </body>
</html>
